package com.zhengjiang.nacos.order.service;

import com.zhengjiang.nacos.order.mapper.OrderMapper;
import com.zhengjiang.nacos.order.model.Order;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("orderService")
public class OrderServiceImpl implements OrderService {

    @Resource
    private OrderMapper orderMapper;

    @GlobalTransactional(rollbackFor = Exception.class)
    @Override
    public void submitOrder(Order order) {
        orderMapper.insert(order);
    }
}
